Skip to content

Conversation

haircommander
Copy link
Contributor

  • One-line PR description:
  • Other comments:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 7, 2025
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 7, 2025
Copy link
Contributor

@kannon92 kannon92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* **What specific metrics should inform a rollback?**
###### What specific metrics should inform a rollback?

The lack of any metrics reported for pods and containers is the worst case scenerio here, and would require either a rollback or for the feature gate to be disabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented above but if kubelet provider is not working, should we expose a metric or something?

If Kubelet is unable to post metrics on a node, it seems difficult to find this out currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if the admin attempted to roll out the feature and it failed, the metric saying provider is 'cadvisor' unexpectedly would be the signal that the fallback happened

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense and the metric is exposed per node?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this is still a very difficult thing for someone to detect.

The lack of any metrics reported for pods and containers is the worst case scenerio here, and would require either a rollback or for the feature gate to be disabled.

So the only way someone who find this out is if a kubelet on a node stopped posting metrics and that pod/container on that node was not found in prometheus.

That seems very complicated to tell if I had 5000 nodes.

Its worth calling out that the rollback failing would be cadvisor but if the metrics are not being posted then what is the best way to find that out? How does one find the bad node via metrics or monitoring?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not addressed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the answer here is above in the GA section where there is:

- Likely, the `cri_losing_support` metric will be used to report that users on versions lower than 2.2 will lose support by a targeted GA version.

Would be good to ensure this is updated here as well.

@kannon92
Copy link
Contributor

kannon92 commented Oct 9, 2025

Please address the verify job failure.

PRR shadow:

I left some comments but overall I think it is close.

@haircommander
Copy link
Contributor Author

thanks @kannon92 updated!

@SergeyKanzhelev
Copy link
Member

+1 to @kannon92 comments. We need a clear transition docs that indicate how to transition. Also there should be graceful period of supporting both equally well, maybe even simultaneously. This was the goal of transition documentation goal for beta - make sure it is reviewed and we understand if we need to announce deprecation or can just suggest an easy migration for each metric

@haircommander
Copy link
Contributor Author

haircommander commented Oct 14, 2025

I have updated based on comments. I have made a couple of things explicity:

  • Windows support is out of scope
  • GA of this feature will drop support for the partial CRI and cadvisor stats providers
    • there's some included motivation on this, but basically there isn't a good way to configure it today, and it was never meant to be configured. Instead, the kubelet is opinionated on what stats provider to use
    • as such, GA will be blocked on containerd 2.2 or above being the only supported containerd, and there being at least 3 releases of delay
  • Sometime in the alpha, we changed the approach of /metrics/cadvisor, now having kubelet translate CRI information to that endpoint. I have tried to update the KEP to reflect this, but this means we're not moving away from metrics/cadvisor endpoint, instead changing its source

@haircommander
Copy link
Contributor Author

Note: we chatted about this in SIG Node and agreed that the stats provider (cadvisor or partial CRI) is an implementation detail, and doesn't currently have any configuration. Introducing configuration to allow an admin to toggle whether we turn on full cri stats just to remove it in a handful of releases doesn't seem worth it. We decided to announce deprecation in beta, and move forward with it in GA when we decide to drop support for containerd < 2.2.

We also chatted with @marosset and agreed that windows support wouldn't block this KEP going to beta but we'd best-effort try to include it because this has been a sore spot for windows for a long time.

#### Alpha -> Beta Graduation
#### Beta

- Conformance tests for the fields in `/metrics/cadvisor` should be created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not have critest for metrics we want to be collected? We need some way confirming that users transition will be seamless

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added!

- cAdvisor stats provider will likely be marked as deprecated (depending on dockershim deprecation).
- cAdvisor stats provider support will be dropped, as well as support for partial cri stats provider.
- Feature gate removed and the CRI stats provider will no longer rely on cAdvisor for container/pod level metrics.
- Conformance tests for stats and metrics being present as expected from the new sources, and performance/scale testing should show comparable performance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does conformance include specific set of metrics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not currently AFAIU

Signed-off-by: Peter Hunt <[email protected]>
### /metrics/cadvisor

1. Expose the metric fields provided in `/metrics/cadvisor` in an analogous Prometheus endpoint directly from the CRI implementation.
1. Expose the metric fields provided in `/metrics/cadvisor` in the same Prometheus endpoint, gathered by Kubelet from from the CRI implementation and reported through the Kubelet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Expose the metric fields provided in `/metrics/cadvisor` in the same Prometheus endpoint, gathered by Kubelet from from the CRI implementation and reported through the Kubelet.
1. Expose the metric fields provided in `/metrics/cadvisor` in the same Prometheus endpoint, gathered by Kubelet from the CRI implementation and reported through the Kubelet.

automations, so be extremely careful here.
Enabling this behavior means some stats endpoints will not be filled:
###### Does enabling the feature change any default behavior?
:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:

@kannon92
Copy link
Contributor

/hold

Based on #5632 (comment), waiting on @SergeyKanzhelev lgtm.

PRR shadow:

Just one item I still think needs more detail on it. #5632 (comment)

I think the answer is that in order to GA this feature we cannot have a node fail to publish metrics via cri. As once this feature is GA there is no alternative so a node would miss kubelet metrics and there is no possible way to recover that once we lock the gate to true and drop the kubelet stats provider code.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 14, 2025
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 14, 2025
@SergeyKanzhelev
Copy link
Member

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 15, 2025
@SergeyKanzhelev
Copy link
Member

/assign @deads2k
/assign @kannon92

@kannon92
Copy link
Contributor

Based on #5632 (comment),

/assign @soltysh

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to conditionally approve the PRR, but here are the things that need to be ensured for this work:

  1. This functionality SHOULD NOT be enabled by default, if containerd doesn't release v2.2 before 1.35 dev cycle ends. Given that v2.2.0-beta.1 was release 5 days ago you should be ok.
  2. Update the missing bits I've mentioned in the doc (mostly the rollback metric, ideally also the template, but that's a minor problem).

/approve
the PRR section

- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
<!-- /toc -->

# cAdvisor-less, CRI-full Container and Pod Stats
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: but it seems this KEP didn't get updated template

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you see a section I missed? I thought I updated the template and I'm not seeing anything missing

* **What specific metrics should inform a rollback?**
###### What specific metrics should inform a rollback?

The lack of any metrics reported for pods and containers is the worst case scenerio here, and would require either a rollback or for the feature gate to be disabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the answer here is above in the GA section where there is:

- Likely, the `cri_losing_support` metric will be used to report that users on versions lower than 2.2 will lose support by a targeted GA version.

Would be good to ensure this is updated here as well.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dchen1107, haircommander, SergeyKanzhelev, soltysh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 15, 2025
@k8s-ci-robot k8s-ci-robot merged commit 000e2fb into kubernetes:master Oct 15, 2025
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.35 milestone Oct 15, 2025
@haircommander
Copy link
Contributor Author

This functionality SHOULD NOT be enabled by default, if containerd doesn't release v2.2 before 1.35 dev cycle ends. Given that v2.2.0-beta.1 was release 5 days ago you should be ok.

I'm not even sure we should do on by default beta until 1.36 anyway, because 2.2 will barely be anywhere when 1.35 releases

@soltysh
Copy link
Contributor

soltysh commented Oct 16, 2025

I'm not even sure we should do on by default beta until 1.36 anyway, because 2.2 will barely be anywhere when 1.35 releases

That's very reasonable approach, I'm definitely supportive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants